﻿using System;
using System.Linq;
using System.Collections.Generic;

namespace Sales
{
    // TODO: New file and name
    public class Item
    {
        public int Id { get; set; }
        public int Quantity { get; set; }
        public decimal UnitPrice { get; set; }

        // TODO: Add missing fields if needed
    }

    public class SupermarketData : IEnumerable<Item>
    {
        public string Name { get; private set; }

        public ICollection<Item> Items { get; private set; }

        public SupermarketData(string name)
        {
            this.Name = name;
            this.Items = new List<Item>();
        }

        public void Add(Item item)
        {
            this.Items.Add(item);
        }

        public IEnumerator<Item> GetEnumerator()
        {
            return this.Items.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return this.GetEnumerator();
        }
    }
}
